import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/Home.vue'
import Potala from '@/views/Potala.vue'
import Hall from '@/views/Hall.vue'
import News from '@/views/News.vue'
import Contact from '@/views/Contact.vue'
import Ticket from '@/views/Ticket.vue'
import NewsDetail from '@/views/NewsDetail.vue'
import HallDetail from '@/views/HallDetail.vue'
import Cultprotect from '@/views/Cultprotect.vue'
import Server from '@/views/Server.vue'
import Help from '@/views/Help.vue'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  base:'/dist',
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      component: Home
    },
    {
      path: '/potala',
      component: Potala
    },
    {
      path: '/cultprotect',
      component: Cultprotect
    },
    {
      path: '/hall',
      component: Hall
    },
    {
      path: '/news',
      component: News
    },
    {
      path: '/server',
      component: Server
    },
    {
      path: '/contact',
      component: Contact
    },
    {
      path: '/ticket',
      component: Ticket
    },
    {
      path: '/news/:id',
      component: NewsDetail
    },
    {
      path: '/hall/:id',
      component: HallDetail
    },
    {
      path: '/help',
      component: Help
    }
  ],
  scrollBehavior(to, from, savedPosition) {
    return { top: 0 };
  }
})

export default router
